home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 22 / autofont.zip / FONTS.BAS < prev    next >
BASIC Source File  |  1987-11-13  |  3KB  |  116 lines

  1. '
  2. ' Fonts.Bas - - to be compiled under MicroSoft QuickBasic 3.0
  3. '
  4. ' A font downloader for the Hewlett-Packard LaserJet+, 500+, and Series II
  5. ' Printers.  Written October 20, 1987 by Jeffrey R. Drumm.
  6. '
  7. ' Version Number 1.0
  8. '
  9. ' Rev. November 11, 1987 to clean up comments.
  10. '
  11. ' Define String Conversion function to strip leading blanks from numbers.
  12. '
  13. Def FNNumToStr$(Num)
  14.      Let Num$   = Str$(Num)
  15.      Let Length = Len(Num$)
  16.      If Left$(Num$,1) <> "-" Then Length = Length - 1
  17.      Let FNNumToStr$ = Right$(Num$,Length)
  18. End Def
  19. '
  20. ' Setup Error handling
  21. '
  22. On Error Goto ErrorHandler
  23. '
  24. ' Read command line, pass to a variable
  25. '
  26. Let CLine$ = Command$
  27. '
  28. ' If command line is blank, assign default file name for font list.
  29. '
  30. If Cline$ = " " Then
  31.     Cline$ = "FONT.LST"
  32. End If
  33. '
  34. ' Show off my name
  35. '
  36. Cls
  37. Print "FONTS: The Font Loader, for Hewlett-Packard LaserJet+ Soft Fonts."
  38. Print " "
  39. Print "     by Jeffrey R. Drumm      "
  40. Print "        ValCom Computer Center"
  41. Print "        470 Forest Ave.       "
  42. Print "        Portland, Maine  04101"
  43. Print "        207-775-5055          "
  44. '
  45. ' Initialize Printer
  46. '
  47. Lprint Chr$(27);"E";
  48. '
  49. ' Open Font selection file
  50. '
  51. Open Cline$ for input as 1
  52. '
  53. ' Set up Loop for Font Selection and ID assignment
  54. '
  55. Let FontID = 0
  56.  
  57. While Not EOF(1)
  58.  
  59.      Let FontID = FontID + 1
  60.      Let FontID$ = FNNumToStr$(FontID)
  61.      '
  62.      ' Assign Font ID number
  63.      '
  64.      Lprint Chr$(27);"*c";FontID$;"D";
  65.      '
  66.      ' Get Font Name from disk file
  67.      '
  68.      Input #1, FontName$
  69.      '
  70.      ' Build command line for Shell statement
  71.      '
  72.      Let CommandLine$ = "Copy " + FontName$ + " PRN: /b > NUL:"
  73.      '
  74.      ' Display font name and ID number on screen
  75.      '
  76.      Locate FontID+8,1
  77.      Print "Downloading ";FontName$;" as font number ";FontID$
  78.      '
  79.      ' Copy font to printer port
  80.      '
  81.      Shell CommandLine$
  82.      '
  83.      ' Make font Permanent
  84.      '
  85.      Lprint Chr$(27);"*c5F";
  86.  
  87. Wend
  88.  
  89. Close #1
  90. Cls
  91. Locate 12,35
  92. Print "All Done!"
  93. '
  94. ' Provide user with audible signal that copying process is done.
  95. ' In this case, Beethoven's Fifth does the job.
  96. '
  97. Play "T180 O2 P2 P8 l8 GGG l2 E- P24 P8 l8 FFF l2 D"
  98. '
  99. ' End of Program.
  100. '
  101. System
  102.  
  103. ErrorHandler:
  104. cls
  105. Print "Your Font Name file does not exist, or is not in the named"
  106. Print "directory.  The default filename is FONT.LST, in the current"
  107. Print "directory.  If your Font Name file is named or located differently,
  108. Print "use the command:"
  109. Print " "
  110. Print "FONTS pathname\fontname.lst"
  111. Print " "
  112. Print "Where pathname is the drive and directory of the Font Name file, "
  113. Print "and fontname.lst is the name of your font name file."
  114. System
  115.  
  116.